/* 通用样式，重置部分默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 内容顶部对齐 */
    align-items: flex-start; /* 内容左对齐 */
    min-height: 100vh;
    padding: 20px;
}

/* 页头样式 */
header {
    width: 100%;
    background-color: #e60000; /* 设置菜单栏背景为红色 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    position: relative;
    text-align: center;
}

.header-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white; /* 标题为白色 */
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: center;
}

.navbar ul li {
    margin-right: 20px;
}

.navbar ul li a {
    text-decoration: none;
    color: white; /* 菜单栏文字为白色 */
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #ffd1d1; /* 悬停为浅红 */
}

.login-link {
    text-decoration: none;
    color: white;
    font-size: 14px;
    margin-top: 10px;
}

/* 主体内容 */
main {
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    margin-top: 30px;
    text-align: left;
}

h2 {
    font-size: 26px;
    color: #e60000; /* 设置标题颜色为红色 */
    margin-bottom: 20px;
}

.post {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.post h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 10px;
}

.post .author {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

.post .excerpt {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
}

.post .excerpt a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.post .excerpt a:hover {
    color: #0056b3;
}

/* 搜索框样式 */
.search-section {
    margin-bottom: 20px;
    text-align: center;
}

.search-section form {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.search-section input[type="text"] {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-right: 10px;
    width: 300px;
}

.search-section input[type="submit"] {
    padding: 10px 20px;
    background-color: #e60000;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-section input[type="submit"]:hover {
    background-color: #cc0000;
}

/* 响应式布局调整 */
@media screen and (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        align-items: center;
    }

    .navbar ul li {
        margin: 10px 0;
    }

    .search-section form {
        flex-direction: column;
    }

    .search-section input[type="text"], 
    .search-section input[type="submit"] {
        width: 100%;
        margin-bottom: 10px;
    }
}
